/**   
 * @Title: CustCapitalsystemOperator.java 
 * @Package com.betterjr.modules.customer.entity 
 * @Description: TODO(用一句话描述该文件做什么) 
 * @author xuzx
 * @date 2017年12月15日 下午6:02:21  
 */
package com.betterjr.modules.customer.entity;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.betterjr.common.annotation.MetaData;
import com.betterjr.common.entity.BetterjrEntity;
import com.betterjr.common.utils.BetterDateUtils;

/** 
 * @ClassName: CustCapitalsystemOperator 
 * @Description: 资金管理系统操作员 
 * @author xuzx
 * @date 2017年12月15日 下午6:02:21 
 *  
 */
@Access(AccessType.FIELD)
@Entity
@Table(name = "t_cloud_platform_operator")
public class CustCloudPlatformOperator implements BetterjrEntity {

    /** 
     * @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么) 
     */
    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "L_OPERATOR_ID", columnDefinition = "INTEGER")
    @MetaData(value = "操作员id", comments = "操作员id")
    private Long userId;

    @Column(name = "C_OPERATOR_NAME", columnDefinition = "VARCHAR")
    @MetaData(value = "操作员名称", comments = "操作员名称")
    private String userName;

    @Column(name = "C_OPERATOR_USER", columnDefinition = "VARCHAR")
    @MetaData(value = "操作员账户", comments = "操作员账户")
    private String userCode;

    @Column(name = "L_TENANT_ID", columnDefinition = "INTEGER")
    @MetaData(value = "集团id", comments = "集团id")
    private Long custID;

    @Column(name = "L_CUSTOM_ID", columnDefinition = "INTEGER")
    @MetaData(value = "客户id", comments = "客户id")
    private Long enteID;

    @Column(name = "C_OPERORG", columnDefinition = "VARCHAR")
    @MetaData(value = "操作机构", comments = "操作机构")
    private String operorg;

    @Column(name = "L_ASSOCIATED_ID", columnDefinition = "INTEGER")
    @MetaData(value = "金服用户关联操作员id", comments = "金服用户关联操作员id")
    private Long associatedID;

    @Column(name = "D_REG_DATE", columnDefinition = "VARCHAR")
    @MetaData(value = "创建日期", comments = "创建日期")
    private String regDate;

    @Column(name = "T_REG_TIME", columnDefinition = "VARCHAR")
    @MetaData(value = "创建时间", comments = "创建时间")
    private String regTime;

    @Transient
    private String password;

    @Override
    public String toString() {
        return "CustCapitalsystemOperator [userId=" + userId + ", userName=" + userName + ", userCode=" + userCode
                + ", custID=" + custID + ", enteID=" + enteID + ", operorg=" + operorg + ", associatedID="
                + associatedID + ", regDate=" + regDate + ", regTime=" + regTime + ", password=" + password + "]";
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long anUserId) {
        userId = anUserId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String anUserName) {
        userName = anUserName;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String anUserCode) {
        userCode = anUserCode;
    }

    public Long getCustID() {
        return custID;
    }

    public void setCustID(Long anCustID) {
        custID = anCustID;
    }

    public Long getEnteID() {
        return enteID;
    }

    public void setEnteID(Long anEnteID) {
        enteID = anEnteID;
    }

    public String getOperorg() {
        return operorg;
    }

    public void setOperorg(String anOperorg) {
        operorg = anOperorg;
    }

    public Long getAssociatedID() {
        return associatedID;
    }

    public void setAssociatedID(Long anAssociatedID) {
        associatedID = anAssociatedID;
    }

    public String getRegDate() {
        return regDate;
    }

    public void setRegDate(String anRegDate) {
        regDate = anRegDate;
    }

    public String getRegTime() {
        return regTime;
    }

    public void setRegTime(String anRegTime) {
        regTime = anRegTime;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String anPassword) {
        password = anPassword;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (associatedID == null ? 0 : associatedID.hashCode());
        result = prime * result + (custID == null ? 0 : custID.hashCode());
        result = prime * result + (enteID == null ? 0 : enteID.hashCode());
        result = prime * result + (operorg == null ? 0 : operorg.hashCode());
        result = prime * result + (password == null ? 0 : password.hashCode());
        result = prime * result + (regDate == null ? 0 : regDate.hashCode());
        result = prime * result + (regTime == null ? 0 : regTime.hashCode());
        result = prime * result + (userCode == null ? 0 : userCode.hashCode());
        result = prime * result + (userId == null ? 0 : userId.hashCode());
        result = prime * result + (userName == null ? 0 : userName.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof CustCloudPlatformOperator)) {
            return false;
        }
        CustCloudPlatformOperator other = (CustCloudPlatformOperator) obj;
        if (associatedID == null) {
            if (other.associatedID != null) {
                return false;
            }
        } else if (!associatedID.equals(other.associatedID)) {
            return false;
        }
        if (custID == null) {
            if (other.custID != null) {
                return false;
            }
        } else if (!custID.equals(other.custID)) {
            return false;
        }
        if (enteID == null) {
            if (other.enteID != null) {
                return false;
            }
        } else if (!enteID.equals(other.enteID)) {
            return false;
        }
        if (operorg == null) {
            if (other.operorg != null) {
                return false;
            }
        } else if (!operorg.equals(other.operorg)) {
            return false;
        }
        if (password == null) {
            if (other.password != null) {
                return false;
            }
        } else if (!password.equals(other.password)) {
            return false;
        }
        if (regDate == null) {
            if (other.regDate != null) {
                return false;
            }
        } else if (!regDate.equals(other.regDate)) {
            return false;
        }
        if (regTime == null) {
            if (other.regTime != null) {
                return false;
            }
        } else if (!regTime.equals(other.regTime)) {
            return false;
        }
        if (userCode == null) {
            if (other.userCode != null) {
                return false;
            }
        } else if (!userCode.equals(other.userCode)) {
            return false;
        }
        if (userId == null) {
            if (other.userId != null) {
                return false;
            }
        } else if (!userId.equals(other.userId)) {
            return false;
        }
        if (userName == null) {
            if (other.userName != null) {
                return false;
            }
        } else if (!userName.equals(other.userName)) {
            return false;
        }
        return true;
    }

    public void initAddValue(CustCloudPlatformOperator custCloudPlatformOperator) {
        this.regDate = BetterDateUtils.getNumDate();
        this.regTime = BetterDateUtils.getNumTime();

    }
}